<?php include 'frame-top.php'; ?>

<div class="segm" style="border-bottom:1px solid #ccc;">
	<h2>课程: &nbsp;
		<span>
			<?php foreach ($this->data as $v) : ?>
			<a href="#course_<?=$v['CId']?>"><?=$v['Name']?></a> &nbsp;
			<?php endforeach; ?>
			<?= auth::check(auth::EDIT_MEMBER)?
				'<input type="button" value="add a course" 
					onclick="add_course();">':''; ?>
		</span>
	</h2>
</div>

<?php 
reset($this->data);
foreach ($this->data as $v) : 
$cid=$v['CId'];
$edit = auth::check(auth::EDIT_LAB_STUFF);
?>

<!-- course -->
<div class="segm"> <a name="course_<?=$cid?>"></a>
	<h2><a href="/education/course/CId/<?=$cid?>"><?=$v['Name'].'.'.$v['EnglishName']?></a>
		<?=$edit?'<input type="button" value="edit"
						onclick="edit_course('.$cid.')" />
				  <input type="button" value="del" 
						onclick="del_course('.$cid.')" />':''?>
	</h2>
	<div class="brief"><?=$v['Intro']?>
		<a href="/education/course/CId/<?=$cid?>">&raquo; 详细信息</a>
	</div>

	<p style="text-align:right;"><a href="#">Top</a></p>
</div> <!-- end of course -->

<?php endforeach; ?>

<?php include 'frame-bottom.php'; ?>
